(* generate a random planar polygon, with specified number of sides *) randomPlanePolygon[n_] := ( (* sample random plane in n-space, as span of A1, A2 *) A1 = RandomVariate[NormalDistribution[0,1], n]; A2 = RandomVariate[NormalDistribution[0,1], n]; (* find orthonormal basis B1, B2 of plane *) {B1, B2} = Orthogonalize[{A1, A2}]; (* square the complex numbers (B1 + i*B2)^2 = C1 + i*C2 *) C1 = B1^2 - B2^2; C2 = 2 * B1 * B2; Pts = Transpose[{C1, C2}]; SumPts = Join[{{0,0}},Accumulate[Pts]]; ListLinePlot[SumPts] ) randomPlanePolygon[12] randomPlanePolygon[500]